package com.ywu.common.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.ToString;

import java.util.Date;

/**
 * @ClassName CommonEntity
 * @Description TODO
 * @Author GroundDemo
 * @Date 2024/2/15 21:41
 * @Version 1.0
 **/
@Data
@ToString
public class CommonEntity {
    private String createBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date createDate;

    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date updateDate;

    private String remark;

    private String tenantId;

    public void createInfo(String name) {
        this.createBy = name;
        this.updateBy = name;
        Date date = new Date();
        this.createDate = date;
        this.updateDate = date;
    }

    public void updateInfo(String name) {
        this.updateBy = name;
        this.updateDate = new Date();
    }
}
